<template>
  <div>
    <FormPanel ref="from" :list="formList" :isSubmitBtn="false" :collapse="false" :labelWidth="110"> </FormPanel>

    <div style="height: 47px"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right',
      }"
    >
      <el-button @click="closeDrawer()">关 闭</el-button>
    </div>
  </div>
</template>
<script>
import { getDetail } from '@/api/omSaleP/OrderManagement/ShipmentOrderQuery/index.js';
import { dictionary } from '@/utils/dictMixin';
import moment from 'moment';
export default {
  props: ['rowData'],
  data() {
    this.saveData = null;
    return {
      formList: this.createdFrom(),
      tableList: [],
    };
  },
  components: {},
  created() {
    this.init();
  },
  mixins: [dictionary],
  methods: {
    //初始化数据
    async init() {
      // console.log('传入数据', this.rowData);
      //给表格赋值
      const res = await getDetail({ id: this.rowData.id });
      if (res.resultCode === 200) {
        if (res.data) {
          for (let i in res.data) {
            this.formList.map((x) => {
              if (x.fieldName == i) {
                x.initialValue = res.data[i];
              }
            });
          }
        }
      }
    },
    async closeDrawer() {
      this.$emit('close');
    },
    createdFrom() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '货运单信息',
        },

        // {
        //   type: 'INPUT',
        //   label: '省份',
        //   fieldName: 'provinceName',
        //   disabled: true,
        // },
        // {
        //   type: 'INPUT',
        //   label: '城市',
        //   fieldName: 'cityName',
        //   disabled: true,
        // },
        {
          type: 'INPUT',
          label: '经销商代码',
          fieldName: 'dealerCode',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '经销商名称',
          fieldName: 'dealerName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '货运单号',
          fieldName: 'transNo',
          disabled: true,
        },
        {
          type: 'SELECT',
          label: '发运状态',
          fieldName: 'transStatus',
          itemList: this.createDictList('2135'),
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'SAP销售单号',
          fieldName: 'sapNo',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'DMS批售订单号',
          fieldName: 'orderNo',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '结算订单编号',
          fieldName: 'doNo',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'VIN',
          fieldName: 'vin',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '资金类型',
          fieldName: 'accountTypeName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '合格证邮寄地址',
          fieldName: 'certificateMailAddress',
          disabled: true,
        },
        {
          type: 'SELECT',
          label: '合格证发放方式',
          fieldName: 'certificateIssueType',
          itemList: this.createDictList('2138'),
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '收车地址',
          fieldName: 'address',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '送达城市',
          fieldName: 'orderCity',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '联系人',
          fieldName: 'linkMan',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '联系电话',
          fieldName: 'linkPhone',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运/自提单位',
          fieldName: 'carrierName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运人/自提人',
          fieldName: 'carrierPersonName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运/自提时间',
          fieldName: 'deliveryDate',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '发车人',
          fieldName: 'sendPersonName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车牌号',
          fieldName: 'trailerBrand',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运司机',
          fieldName: 'driverName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '司机联系方式',
          fieldName: 'driverTel',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '收车人',
          fieldName: 'receiver',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '收车时间',
          fieldName: 'receiveDate',
          disabled: true,
        },
        {
          type: 'SELECT',
          label: '运输方式',
          fieldName: 'transportType',
          itemList: this.createDictList('2409'),
          placeholder: '',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料编码',
          fieldName: 'productCode',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料描述',
          fieldName: 'productName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车系',
          fieldName: 'seriesName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车型',
          fieldName: 'modelName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '配置',
          fieldName: 'configName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '选装',
          fieldName: 'optionName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '内饰',
          fieldName: 'trimName',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '外饰',
          fieldName: 'colorName',
          disabled: true,
        },
      ];
    },
  },
};
</script>
<style lang="less">
.discount {
  text-decoration: underline;
  color: #d1291a;
  cursor: pointer;
}
</style>
